<template>
	<view :class="[BackGround]" :style="[{'font-weight':Style,'font-family':Font,height:100 + '%',minHeight:height + 'px'}]">
		<cu-custom bgColor="bg-gradual-blue" isBack="true">
			<view slot="backText">返回</view>
			<view slot="content">自定义报表</view>
		</cu-custom>
		<sear-ch :placeholder="placeholder" @clean="clean" @input="input" @remove="remove" :message="message"></sear-ch>
		<screen-view ref="screen" @formSubmit="formSubmit" :columnisShow="true" :column="column" :searchisShow="false"
		 :isShow="false" :startbefore="dateleft" @checkboxChange="checkboxChange"></screen-view>
		<z-table :tableData="deliverplanfive" :stickSide="false" :showSelect="false" :showBottomSum="false" :columns="finaleColumnsfive"
		 @onSort="doSort" @onSelect="tableSelect"></z-table>
	</view>
</template>

<script>
	import SearCh from "@/colorui/components/search.nvue";
	import ScreenView from '@/colorui/components/ScreenView.vue'
	import zTable from "@/colorui/components/z-table.vue";
	import utils from '@/static/js/utils.filter.js';
	import {
		mapGetters
	} from "vuex";
	import {
		inputSearch,
		viewTable
	} from "@/mixin/mixin.js"
	import {
		OA
	} from "@/service/selectList.js"
	export default {
		mixins: [viewTable, inputSearch],
		data() {
			return {
				placeholder: "员工号",
				height: this.screenHeight,
				message: '筛选',
				dateleft: global.startbefore,
				dateright: global.dateright,
				searchView: "code",
				column: [{
						name: '台号',
						value: '台号',
						checked: true
					},
					{
						name: '班组',
						value: '班组',
						checked: true
					},
					{
						name: '姓名',
						value: '姓名',
						checked: true
					},
					{
						name: '班次',
						value: '班次',
						checked: true
					}
				]
			}
		},
		computed: {
			...mapGetters(["Style", 'Font', 'BackGround', 'BackGroundBox'])
		},
		components: {
			SearCh,
			ScreenView,
			zTable,
		},
		onLoad() {
			const fn = (a, b) => a.filter(item => b.includes(item.title))
			this.list = fn(this.finaleColumnsfive, ['台号', '班组', '姓名', '班次', ])
			this.deliverplan = this.deliverplanfive
		},
		methods: {
			formSubmit(e) {
				console.log(e);
				for (let value of this.deliverplan) {
					if (value['name'].search(e.name) != -1 && value['chejian'].search(e.chejian) != -1 && value['age'].search(e.age) != -1) {
						console.log(value);
						value.isShow = true
					} else {
						value.isShow = false
					}
				}
			},
			checkboxChange(e) {
				(function(a, b) {
					a.filter(function(item) {
						if (b.includes(item.title)) {
							item.isShow = true
						} else {
							item.isShow = false
						}
					})
				})(this.list, e)
			}
		}
	}
</script>

<style>

</style>
